//
//  SDAddPhotoInfoData.m
//  SKinDiary
//
//  Created by pcyang on 16/7/25.
//  Copyright © 2016年 tencent. All rights reserved.
//

#import "SDAddPhotoInfoData.h"

@implementation SDAddPhotoInfoData
-(NSString*)getFullURL
{
    return [NSString stringWithFormat:@"%@/photo",[[SDServerSwitchManager sharedInstance] getServerUrl]];
}

-(NSDictionary*) getPostDictionary
{
    NSMutableDictionary* dict = [NSMutableDictionary dictionaryWithCapacity:6];
    
    [dict setObject:[NSNumber numberWithInteger:_photoInfo.patientId] forKey:@"patientId"];
    [dict setObject:[_photoInfo.photoUrl safeString] forKey:@"photoUrl"];
    [dict setObject:[_photoInfo.comments safeString]forKey:@"comments"];
    [dict setObject:[_photoInfo.tag safeString] forKey:@"tag"];
    [dict setObject:[_photoInfo.mode safeString] forKey:@"mode"];
    [dict setObject:[_photoInfo.position safeString] forKey:@"position"];
    [dict setObject:[_photoInfo.status safeString] forKey:@"status"];

    return dict;
}

+(id)modelFromResponseValues:(id)infos error:(NSError**)error
{
    return infos;
}

- (id)resetWithResponseModel:(id)data
{
    if([data isKindOfClass:[NSDictionary class]])
    {
        SDPhotoInfo* tmpPhotoInfo = [[SDPhotoInfo alloc] initWithInfo:[data objectForKey:@"photos"]];
        _photoInfo.id = tmpPhotoInfo.id;
        _photoInfo.photoUrl = tmpPhotoInfo.photoUrl;
        
    }
    
    return data;
}
@end
